<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex bindMobilePhone_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center justify-between flex-sub bindMobilePhone_fd0_0'>
					<view class='flex align-center bindMobilePhone_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<text class='fu-iconfont2  bindMobilePhone_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex align-center'>
						<text class='bindMobilePhone_fd0_0_c1_c0'>绑定手机</text>
					</view>
					<view class='flex align-center bindMobilePhone_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout bindMobilePhone_flex_1">
				<view class='flex flex-wrap align-center bindMobilePhone_fd1_0'>
					<image class='bindMobilePhone_fd1_0_c0' mode="aspectFit" :src='STATIC_URL+"36.png"'></image>
					<benben-input class='flex-sub bindMobilePhone_fd1_0_c1' type="number" :placeholder="`请输入手机号`"
						confirm-type="done" :maxlength="11"
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="mobile" />
				</view>
				<view class='flex flex-wrap align-center bindMobilePhone_fd1_0'>
					<image class='bindMobilePhone_fd1_1_c0' mode="aspectFit" :src='STATIC_URL+"40.png"'></image>
					<benben-input class='flex-sub bindMobilePhone_fd1_0_c1' type="number" :placeholder="`请输入验证码`"
						confirm-type="done" :maxlength="6"
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="code" />
					<benben-send-verification-code key='1661226040916' ref="vCode1661226040916"
						class=' bindMobilePhone_fd1_1_c2' after-text='后重新获取' before-text='获取验证码' type='2'
						:phone="mobile"></benben-send-verification-code>
				</view>
				<view class='flex flex-wrap align-center bindMobilePhone_fd1_0'>
					<image class='bindMobilePhone_fd1_1_c0' mode="aspectFit" :src='STATIC_URL+"37.png"'></image>
					<benben-flex-password-diy v-model="password"
						class-name="flex align-center flex bindMobilePhone_fd1_2_c1" :placeholder="'请输入密码(6~12位字母+数字)'"
						:maxlength="12" :default-type='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx">
						<template #show>
							<text class='fu-iconfont2  bindMobilePhone_fd1_2_c1_icon1' data-type="show">&#xE837;</text>
						</template>
						<template #hide>
							<text class='fu-iconfont2  bindMobilePhone_fd1_2_c1_icon1' data-type="hide">&#xEBCC;</text>
						</template>
					</benben-flex-password-diy>
				</view>
				<view class='flex flex-wrap align-center'>
					<button class='bindMobilePhone_fd1_3_c0' @tap.stop="bindMobileFunc()">提交</button>
				</view>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"mobile": "",
				"code": "",
				"password": "",
				"data": {
					"userinfo": {
						"user_token": "",
						"id": "",
						"account": "",
						"avatar": "",
						"real_name": "",
						"nickname": "",
						"email": "",
						"gender": "",
						"mobile": "",
						"birthday": "",
						"client_id": "",
						"phone": ""
					}
				},
				"unionid": null,
				"client_id": null,
				"openid": null,
				"avatarUrl": null,
				"nickName": null
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				unionid,
				client_id,
				openid,
				avatarUrl,
				nickName
			} = options
			if (unionid !== undefined) this.unionid = unionid
			if (client_id !== undefined) this.client_id = client_id
			if (openid !== undefined) this.openid = openid
			if (avatarUrl !== undefined) this.avatarUrl = avatarUrl
			if (nickName !== undefined) this.nickName = nickName
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//绑定手机号
			bindMobileFunc() {
				if (!validate(this.mobile, 'require')) {
					this.$message.info('请输入手机号');
					return false;
				}
				if (!validate(this.mobile, 'phone')) {
					this.$message.info('请输入正确的手机号');
					return false;
				}
				if (!validate(this.code, 'require')) {
					this.$message.info('请输入验证码');
					return false;
				}
				if (!validate(this.code, 'captcha')) {
					this.$message.info('请输入正确的验证码');
					return false;
				}
				if (!validate(this.password, 'require')) {
					this.$message.info('请输入密码(6~12位字母+数字)');
					return false;
				}
				if (!validate(this.password, 'password')) {
					this.$message.info('请输入正确密码(6~12位字母+数字)');
					return false;
				}
				this.$urouter.switchTab(`/pages/tabBar/homePage/homePage`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.bindMobilePhone_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.bindMobilePhone_fd0_0_c1_c0 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 500;
	}

	.bindMobilePhone_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.bindMobilePhone_fd0_0_c0 {
		width: 180rpx;
	}

	.bindMobilePhone_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.bindMobilePhone_flex_1 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.bindMobilePhone_fd1_3_c0 {
		background: var(--benbenbgColor0);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		width: 686rpx;
		height: 88rpx;
		line-height: 88rpx;
		font-weight: 500;
		margin: 104rpx 0rpx 0rpx 0rpx;
	}

	.bindMobilePhone_fd1_2_c1_icon1 {
		width: 88rpx;
		line-height: 88rpx;
		text-align: center;
		font-size: 40rpx;
	}

	::v-deep .bindMobilePhone_fd1_2_c1 {
		font-size: 32rpx;
		width: 620rpx;
		font-weight: 400;
		color: #333;
	}

	.bindMobilePhone_fd1_1_c2 {
		font-size: 28rpx;
		font-weight: 400;
		color: #57AEFB;
		line-height: 40rpx;
	}

	.bindMobilePhone_fd1_1_c0 {
		width: 34rpx;
		height: 34rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 28rpx 0rpx -4rpx;
	}

	.bindMobilePhone_fd1_0_c1 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.bindMobilePhone_fd1_0_c0 {
		width: 34rpx;
		height: 34rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 28rpx 0rpx 0rpx;
	}

	.bindMobilePhone_fd1_0 {
		border-bottom: 1px solid #eee;
		height: 125rpx;
	}
</style>